

/*IDENTIFY FEDERAL FUNDING */	

replace funding_type="FEDERAL" if strpos(funding_source,"UNITED STATES")>0&funding_type==""
replace funding_type="FOREIGN" if strpos(funding_source,"UNITED STATES")>0&funding_type_source!="CFDA"&strpos(funding_source,"ISRAEL")>0
replace funding_type="FOREIGN" if strpos(funding_source,"UNITED STATES")>0&funding_type_source!="CFDA"&strpos(funding_source,"JAPAN")>0
replace funding_type="FEDERAL" if strpos(funding_source,"FEDERAL")>0&funding_type==""&substr(funding_source,1,2)!="SW"
replace funding_type="FEDERAL" if strpos(funding_source,"DEPARTMENT")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"US DEPARTMENT")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,", DEPARTMENT OF")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"U.S. DEPARTMENT")>0&funding_type==""
replace funding_type="STATE" if strpos(funding_source,"DEPARTMENT")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"U.S. DEPT")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"US DEPT")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,", DEPT")>0&funding_type==""&strpos(funding_source,"FED")>0
replace funding_type="STATE" if strpos(funding_source,", DEPT")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"U.S. ")==1&funding_type==""

replace funding_type="FEDERAL" if strpos(funding_source,"DEPT OF AGRICULTURE")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"AGRICULTURE DEPT")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"U. S. DEPT")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"US NATIONAL")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"HEALTH & HUMAN NIH")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"NIH/")>0&funding_type==""
replace funding_type="STATE" if strpos(funding_source,"DEPT")>0&funding_type==""

replace funding_type="FEDERAL" if strpos(funding_source,"AGENCY")>0&funding_type==""&strpos(funding_source,"AREA")==0
replace funding_type="FEDERAL" if strpos(funding_source,"ADMINISTRATION")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"CENTERS FOR DISEASE CONTROL")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"INTERIOR, ")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"NASA")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"HEALTH & HUMAN")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"OFFICE OF JUVENILE JUSTICE")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"PRESIDENT, EXECUTIVE OFFICE")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"AIR FORCE OFFICE OF SCIENTIFIC")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"DIRECTOR OF NATIONAL INTELLIGENCE")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"NATIONAL INSTITUTES OF HEALTH")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"OFFICE OF THE NATIONAL COORDINATOR")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"NUCLEAR REGULATORY COMMISSION")>0&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"CENTER FOR DISEASE CONTROL")==1&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"CENTERS FOR MEDICARE & MEDICAID")==1&funding_type==""
replace funding_type="FEDERAL" if funding_source=="FERMI NATIONAL ACCELERATOR LABORATORY"&funding_type==""
replace funding_type="FEDERAL" if funding_source=="AIR FORCE RESEARCH LABORATORY"&funding_type==""
replace funding_type="FEDERAL" if funding_source=="SMITHSONIAN INSTITUTION"&funding_type==""
replace funding_type="FEDERAL" if funding_source=="LIBRARY OF CONGRESS"&funding_type==""
replace funding_type="FEDERAL" if funding_source=="PEACE CORPS"&funding_type==""
replace funding_type="FEDERAL" if funding_source=="OFFICE OF NAVAL RESEARCH"&funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source,"NATIONAL ")==1&funding_type==""
replace funding_type="PRIVATE" if funding_source=="NATIONAL PHILANTHROPIC TRUST"&funding_type_source!="CFDA"
replace funding_type="FEDERAL" if strpos(funding_source,"CORPORATION")==1&funding_type==""&strpos(funding_source,"JEFF")==0

/*IDENTIFY FEDERAL FUNDING */
replace funding_type="UNIVERSITY" if strpos(funding_source,"UNIVERSITY")>0&funding_type==""
replace funding_type="UNIVERSITY" if funding_source=="GEORGIA INSTITUTE OF TECHNOLOGY"&funding_type==""
replace funding_type="UNIVERSITY" if strpos(funding_source,"COLLEGE")>0&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="COLLEGE ADVISING CORPS"&funding_type_source!="CFDA"
replace funding_type="UNIVERSITY" if funding_source=="MASSACHUSETTS INSTITUTE OF TECHNOLOGY"&funding_type==""
replace funding_type="UNIVERSITY" if funding_source=="HARVARD MEDICAL SCHOOL"&funding_type==""
replace funding_type="UNIVERSITY" if strpos(funding_source,"SCHOOL OF")>0&funding_type==""
replace funding_type="UNIVERSITY" if strpos(funding_source,"UNIVERSIT")>0&funding_type==""

/*IDENTIFY STATE AND LOCAL FUNDING */

replace funding_type="STATE" if strpos(funding_source,"HEALTH, ")==1&funding_type==""
replace funding_type="STATE" if strpos(funding_source,"STATE")==1&funding_type==""
replace funding_type="STATE" if strpos(funding_source," STATE")>0&funding_type==""&strpos(funding_source,"EMPIRE")==0
replace funding_type="STATE" if funding_source=="COMMONWEALTH OF PENNSYLVANIA"&funding_type==""
replace funding_type="STATE" if funding_source=="LAND & NATURAL-FORESTRY & WILD"&funding_type==""
replace funding_type="STATE" if funding_source=="NYS"&funding_type==""
replace funding_type="STATE" if funding_source=="FUND FOR PUBLIC SCHOOLS"&funding_type==""
replace funding_type="STATE" if strpos(funding_source,"OHIO")>0&funding_type_source!="CFDA"
replace funding_type="STATE" if strpos(funding_source,"CINCINNATI")>0&funding_type_source!="CFDA"
replace funding_type="STATE" if strpos(funding_source,"HAWAII")>0&funding_type_source!="CFDA"
replace funding_type="STATE" if strpos(funding_source,"-HI")>0&funding_type_source!="CFDA"&strpos(funding_source,"-HILL")==0
replace funding_type="STATE" if funding_source=="HUMAN SERVICE AGENCY"&funding_type_source!="CFDA"
replace funding_type="STATE" if strpos(funding_source,"CITY OF")>0&funding_type==""
replace funding_type="STATE" if strpos(funding_source,"COUNTY")>0&funding_type_source!="CFDA"
replace funding_type="STATE" if strpos(funding_source,"LAND & NATURAL")>0&funding_type==""
replace funding_type="STATE" if strpos(funding_source,"TOWN")>0&funding_type==""


/* IDENTIFY PRIVATE FUNDING */

replace funding_type="PRIVATE" if substr(funding_source,-3,3)=="LLC"&funding_type_source!="CFDA"
replace funding_type="PRIVATE-FORPROFIT" if substr(funding_source,-3,3)=="LTD"&funding_type_source!="CFDA"
replace funding_type="PRIVATE-FORPROFIT" if substr(funding_source,-4,4)=="GMBH"&funding_type_source!="CFDA"
replace funding_type="PRIVATE" if substr(funding_source,-4,4)=="CORP"&funding_type_source!="CFDA"
replace funding_type="PRIVATE-FORPROFIT" if substr(funding_source,-5,5)=="CORP."&funding_type_source!="CFDA"
replace funding_type="PRIVATE" if substr(funding_source,-10,10)=="CORPORATED"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if substr(funding_source,-3,3)==" CO"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if substr(funding_source,-3,3)=="CO."&funding_type==""
replace funding_type="PRIVATE" if substr(funding_source,-3,3)==" AG"&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source,"HOSPITAL")>0&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if substr(funding_source,-7,7)=="COMPANY"&funding_type==""
replace funding_type="PRIVATE" if substr(funding_source,-12,12)=="THERAPEUTICS"&funding_type==""
replace funding_type="PRIVATE" if substr(funding_source,-7,7)=="BIOTECH"&funding_type=="" // is this a good idea??
replace funding_type="PRIVATE" if strpos(funding_source,"MEDICAL CENTER")>0&funding_type==""
replace funding_type="PRIVATE" if substr(funding_source,-7,7)=="LIMITED"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source,"FOUNDATION")>0&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source,"ASSOCIATION")>0&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source,"ENDOWMENT")>0&funding_type==""
replace funding_type="PRIVATE" if substr(funding_source,-5,5)==" FUND"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source,"CORPORATION")>0&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source,"PHARMA")>0&funding_type==""
replace funding_type="PRIVATE" if substr(funding_source,-4,4)==" INC"&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source," INC.")>0&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source," INC ")>0&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source," INC,")>0&funding_type==""
replace funding_type="PRIVATE" if substr(funding_source,-13,13)=="INTERNATIONAL"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source,"AMERICAN ")==1&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source,"CHARIT")>0&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if substr(funding_source,-6,6)==" TRUST"&funding_type==""

replace funding_type="PRIVATE" if funding_source=="PRIVATE SPONSOR"&funding_type==""
replace funding_type="PRIVATE" if funding_source=="OTHER - AUXILIARY ENTERPRISES"&funding_type==""
replace funding_type="PRIVATE" if funding_source=="PRIV"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source,"NOVARTIS")>0&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source,"PATIENT CENTERED")==1&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source,"PATIENT-CENTERED")==1&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source,"SATELLITE HEALTHCARE")>0&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source,"MERCK")>0&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="BRISTOL MYERS SQUIBB"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="ABBOTT LABORATORIES"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="ASTRAZENECA"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="BIOGEN IDEC"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="CHILDRENS HEALTHCARE OF ATLANTA"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="COMMUNITY BEHAVIORAL HEALTH"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="EDWARDS LIFESCIENCES"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="GENENTECH"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="GENERAL ELECTRIC AVIATION"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="GEORGIA CANCER COALITION"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="GILEAD SCIENCES"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="GLAXOSMITHKLINE"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="HEMOPHILIA OF GEORGIA"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="HOWARD HUGHES MEDICAL INSTITUTE"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="SANOFI AVENTIS"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="PFIZER"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="MAGELLAN HEALTH SERVICES"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="TRI-ISLE RESOURCE CONSERVATION"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="AMER CANCER SOCIETY"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="MEDTRONIC"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="RESEARCH TO PREVENT BLINDNESS"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="BOSTON SCIENTIFIC"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source,"ORGANIZATION")>0&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source,"INITIATIVE")>0&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if substr(funding_source,-5,5)==" ASSN"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source,"LTD.")>0&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source,"LLC.")>0&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source,"NOVO NORDISK")>0&funding_type==""
replace funding_type="PRIVATE" if strpos(funding_source,"CLINIC")>0&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="LEUKEMIA AND LYMPHOMA SOCIETY"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source=="MICHAEL J FOX FDTN FOR PARKINSONS RES"&funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source=="HOFFMANN LAROCHE"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if substr(funding_source,-5,5)==" FDTN"&funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if substr(funding_source,-4,4)==" ORG"&funding_type==""

/* IDENTIFY FOREIGN FUNDING */

replace funding_type="FOREIGN" if funding_source=="CHINESE CONSULATE GENERAL"&funding_type==""
replace funding_type="FOREIGN" if strpos(funding_source,"EUROPEAN COMMISSION")>0&funding_type==""
replace funding_type="FOREIGN" if strpos(funding_source,"UNITED NATIONS")>0&funding_type==""
replace funding_type="FOREIGN" if strpos(funding_source,"FRENCH")>0&funding_type_source!="CFDA"
replace funding_type="FOREIGN" if strpos(funding_source,"BRITISH")>0&funding_type_source!="CFDA"
replace funding_type="FOREIGN" if strpos(funding_source,"AUSTRALIA")>0&funding_type_source!="CFDA"
replace funding_type="FOREIGN" if strpos(funding_source,"JAPAN")>0&funding_type_source!="CFDA"
replace funding_type="FOREIGN" if strpos(funding_source,"INTERNATIONAL AGENCY")>0&funding_type_source!="CFDA"
replace funding_type="FOREIGN" if strpos(funding_source,"INTERNATL AGENCY")>0&funding_type_source!="CFDA"
replace funding_type="FOREIGN" if strpos(funding_source,"INTL ATOMIC ENERGY AGENCY")>0&funding_type_source!="CFDA"


replace funding_type="PRIVATE-NONPROFIT" if funding_source=="NATIONAL MULTIPLE SCLEROSIS SOCIETY"&funding_type_source!="CFDA"

******************************
*** 7/1 New categorization ***
******************************

* Identify private funding

replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "SOCIETY")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "SOLUTIONS")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, "GROUP")>0 & funding_type==""
replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "FND")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, "FOUN")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, " CO.")>0 & funding_type==""
replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "ASSOC")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, ",INC")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "COMPAN")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "COMPNAY")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "PLC")>0 & funding_type==""
replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "ACADEMY")>0 & funding_type==""
replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "ALLIANCE")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, "INIT")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, "FDTN")>0 & funding_type==""
replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "MACARTHUR")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "3M")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "JOHNSON")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "SIEMENS")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "MICROSOFT")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "CHEVRON")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "GENERAL ELECTRIC")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, "BIOSCIENCE")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, "BIOTECH")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "HEWLETT PACKARD")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "HP")>0 & funding_type==""
replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "WORLD BANK")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "UNILEVER")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "SAMSUNG")>0 & funding_type==""
replace funding_type = "PRIVATE-FORPROFIT" if strpos(funding_source, "GLAXOSMITHKLINE")>0 & funding_type==""
replace funding_type = "PRIVATE" if strpos(funding_source, "LLC")>0 & funding_type==""
replace funding_type = "PRIVATE-NONPROFIT" if strpos(funding_source, "PEW")>0 & funding_type==""

* Identify education funding
replace funding_type = "UNIVERSITY" if strpos(funding_source, "UNIV")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "CALIFORNIA INST OF TECH")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "CALIFORNIA INST OF TECH")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "RENSSELAER POLYTECHNIC INSTITUTE")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "GEORGIA INSTITUTE")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "GEORGE WASHINGTON INST")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "RENSSELAER POLYTECHNIC INSTITUTE")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "WOODS HOLE")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "ILLINOIS INST")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "CALVIN INSTITUTE")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "NORTH CAROLINA CHAPEL HILL")>0 & funding_type==""
replace funding_type = "UNIVERSITY" if strpos(funding_source, "NYU")>0 & funding_type==""



* Identify foreign funding
replace funding_type = "FOREIGN" if strpos(funding_source, "KOREA")>0 & funding_type == ""
replace funding_type = "FOREIGN" if strpos(funding_source, "MINISTRY")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "KOREAN")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "ISRAEL")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "GERMAN")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "NYU ABU DHABI")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "SOUTH AFRICAN")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "INDIAN")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "TAIWAN")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "DAEGU GYEONGBUK")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "GWANGJU")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "SHANGHAI")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "OKINAWA")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "PALAU")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "KING ABDULAZIZ")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "ANYANG")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "SAUDI ARABIA")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "ALBERTA")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "CANADA")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "ZAMBIA")>0 & funding_type==""
replace funding_type = "FOREIGN" if strpos(funding_source, "SWITZERLAND")>0 & funding_type==""


* Identify federal funding
replace funding_type = "FEDERAL" if strpos(funding_source, "WARFARE")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "BUREAU")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "NAVAL")>0 & funding_type==""
replace funding_type = "FEDERAL" if funding_source=="OFFICE OF JUSTICE PROGRAMS"& funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "SOCIAL SECURITY") & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "CONGRESS") & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "NATIONAL LAB")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "NATL LAB")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "SMITHSONIAN")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, ", DPT")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "MARINE CO")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "USDA")>0 & funding_type==""
replace funding_type = "FEDERAL" if strpos(funding_source, "FULBRIGHT")>0 & funding_type==""
replace funding_type="FEDERAL" if funding_source=="VA BOSTON HEALTHCARE SYSTEM"&funding_type==""

* Identify state funding
replace funding_type = "STATE" if strpos(funding_source, "OFFICE OF")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "AIDS INSTITUTE")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "NYS")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "NEW YORK")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "AIDS INSTITUTE")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "ATLANTA")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "HUALAPAI TRIBE")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "IOWA")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "KANSAS")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "OKLAHOMA")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "ARIZONA")>0 & funding_type==""
replace funding_type = "STATE" if strpos(funding_source, "DES MOINES")>0 & funding_type==""
replace funding_type="STATE" if funding_source=="BEN FRANKLIN TECH CENTER"&funding_type==""

* Identifying some freqeunt flyers
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "BATTELLE")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "CANCER RESEARCH INSTITUTE" & funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source, "COMMERCE, DEPARTMENT")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "FARBER CANCER")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "ELECTRIC POWER RESEARCH INSTITUTE" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "FLIGHT ATTENDANT MEDICAL RESEARCH")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "AMGEN" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "ASTRAZENECA")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "BAYER")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "MERIEUX")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "BRISTOL-MYERS")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "CELGENE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "CENTOCOR" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "CEPHALON" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "CEREGENE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "CEREGO" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "CERVEL NEUROTECH" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "CHARACTER LAB" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "CHILD MIRACLE NETWORK" & funding_type==""
replace funding_type="FOREIGN" if strpos(funding_source, "COMMONWEALTH OF NO MARIANA")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "CONCENTRIC MEDICAL" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "COUNCIL ON LIBRARY AND INFO")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "COVANCE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "COVIDIEN" & funding_type==""
replace funding_type="FOREIGN" if funding_source == "DUBAI CARES" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "HEMOPHILIA CENTER" & funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source, "HHS")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "HUMAN GENOME SCIENCES" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "HUMANA" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "HUTCHINSON")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "IMAGINATION INSTITUTE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "IMCLONE")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "INSTITUTE FOR TRANSFUSION MEDICINE" & funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source, "INSTITUTE OF MUSEUM AND LIBRARY")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "INTERACT FOR HEALTH" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "JAEB CENTER FOR HEALTH RESEARCH" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "JANSSEN")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "KAISER")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "LEATHER INDUSTRIES OF AMERICA" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "MARCH OF DIMES")>0 & funding_type==""
replace funding_type="STATE" if funding_source == "MASSACHUSETTS TECHNOLOGY COLLABORATIVE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "MCNEILL CONSUMER HEALTHCARE" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "MEDICINES 360" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "MEDICINES360" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "MEDIMMUNE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "MEDPACE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "MEDTRONIC")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "MEMORIAL SLOAN")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "MESOBLAST")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "NATL MARROW DONOR PROGRAM" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "NEURALSTEM" & funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source, "PARALYZED VET")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source,"PARKER INSTITUTE")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "PHILIPS")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "PPD")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "PLANNED PARENTHOOD")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "SANOFI")>0 & funding_type==""
replace funding_type="STATE" if funding_source == "SCHOOL DISTRICT OF PHILADELPHIA" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "SEATTLE GENETICS" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "SHIRE")>0 & funding_type==""
replace funding_type="UNIVERSITY" if funding_source == "SPACE TELESCOPE SCIENCE INSTITUTE" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "STANLEY MEDICAL RESEARCH INSTITUTE" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "SUSAN G. KOMEN FOR THE CURE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "TERCICA" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "TRUVEN")>0 & funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source, "INTERIOR")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "JSTOR")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "KELLOGG USA" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "KEMIRA CHEMICALS" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "KROGER" & funding_type==""
replace funding_type="FEDERAL" if strpos(funding_source, "LAND NATURAL")>0 & funding_type==""
replace funding_type="STATE" if funding_source == "LANE EDUCATION SERVICES DISTRICT ODE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "MARATHON OIL" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "MERIT NETWORK" & funding_type==""
replace funding_type="STATE" if strpos(funding_source, "MICHIGAN INTEGRATED")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "MONDELEZ GLOBAL" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "MORPHOTEK" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "NURTUR HEALTH" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "MARATHON OIL" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "OAKWOOD HEALTHCARE SYSTEMS" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "PAXVAX" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "PHILADELPHIA YOUTH NETWORK" & funding_type==""
replace funding_type="STATE" if funding_source == "PILOT POINT INDEPENDENT SCHOOL DISTRICT" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "PROVIDENCE HEALTH SYSTEMS" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "QUINTILES")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "REGENX")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "REXENE" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "RESPIVERT" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "RICOH INNOVATIONS" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "ROCHE")>0 & funding_type==""
replace funding_type="STATE" if strpos(funding_source, "SAINT LOUIS MENTAL")>0 & funding_type==""
replace funding_type="STATE" if strpos(funding_source, " ISD")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "SEMICONDUCTOR RESEARCH" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "SIEMENS")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if strpos(funding_source, "SHELL")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "SONORAN INSTITUTE" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "ST JOSEPH MERCY HEALTH SYSTEMS" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "ST JUDE MEDICAL" & funding_type==""
replace funding_type="STATE" if funding_source == "ST LOUIS CTY CHILD S SERVICES" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "ST LUKE S HEALTH SYSTEMS" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "STANLEY MEDICAL")>0 & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "STARFISH")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "STATOIL GULF SERVICES" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if strpos(funding_source, "SUSAN G KOMEN")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "SYNTHES" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "T2 BIOSYSTEMS" & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "TAKARA BIO" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "TINNITUS RESEARCH CONSORTIUM" & funding_type==""
replace funding_type="PRIVATE-NONPROFIT" if funding_source == "TRI ISLE RESOURCES CONSERVATION" & funding_type==""
replace funding_type="STATE" if  strpos(funding_source, "TX COMMISSION")>0 & funding_type==""
replace funding_type="STATE" if  strpos(funding_source, "TX")>0 & funding_type==""
replace funding_type="FEDERAL" if  strpos(funding_source, "VA ")>0 & funding_type==""
replace funding_type="PRIVATE-FORPROFIT" if funding_source == "VARIAN MEDICAL SYSTEMS" & funding_type==""

